import 'dart:typed_data';
class BleDevice{
  String name;/// 蓝牙广播名

  String mac;/// 蓝牙Mac地址

  Uint8List scanRecord;/// 广播数据

  int rssi;

  bool isBind = false;

  BleDevice({this.name, this.mac, this.scanRecord, this.rssi,this.isBind=false}); //初始信号强度


  BleDevice.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    mac = json['mac'];
    scanRecord = json['scanRecord'];
    rssi = json['rssi'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['mac'] = this.mac;
    data['scanRecord'] = this.scanRecord;
    data['rssi'] = this.rssi;
    return data;
  }

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      other is BleDevice &&
          runtimeType == other.runtimeType &&
          name == other.name &&
          mac == other.mac;

  @override
  int get hashCode => name.hashCode ^ mac.hashCode;
}